Create Chat
Creates a new chat from a prompt, zip archive, or GitHub repository. Prompt chats block until the model response is complete and return the chat.
Usage
import { v0 } from 'v0-sdk'const result = await v0.chats.create({ message: 'Hello, world!', type: 'prompt',})console.log(result)From GitHub Repository
import { v0 } from 'v0-sdk'const result = await v0.chats.create({ type: 'repo', repo: { url: 'https://github.com/vercel/next.js', branch: 'canary', }, title: 'Analyze Next.js repo',})console.log(result)API Signature
Request
Request Body
Request body. Set type to select the initialization method.
The prompt or instruction to send to the model.
System-level context for the chat, such as frameworks or development environment details.
Overrides for the model behavior.
Model to use for the generation.
Enables image generations to generate up to 5 images per version.
Files or assets to include with the message.
URL of the attachment.
MCP server IDs to enable. When omitted, uses default enabled servers.
Skill IDs (from skills.sh) to attach. Skills provide domain-specific knowledge to the AI. Maximum 3.
Initialize the chat by sending a prompt to the model.
Visibility setting for the new chat.
Title for the new chat.
Arbitrary key-value data to attach to the chat.
Response
Unique chat identifier.
Chat title, if generated.
Visibility setting of the chat.
ISO timestamp of when the chat was created.
ISO timestamp of when the chat was last updated.
ID of the user who created the chat.
Associated Vercel project ID, if any.
User-defined key-value metadata.
Whether the caller has write access to this chat.
Token usage and credit cost for prompt.
Token counts for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.
Credit cost for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.